package com.security.vo;

import lombok.Data;

import java.io.Serializable;

/**
 * Package: com.security
 * Description：
 * Author: huangjian
 * Date:  2020/9/16 15:00
 * Modified By:
 * @author huangjian
 */
@Data
public class RestfulDTO implements Serializable {

    private Integer code;
    private String message;
    private Object data;
    private String sign;
    public static RestfulDTO success(){
        RestfulDTO restfulDTO = new RestfulDTO();
        restfulDTO.setCode(200);
        restfulDTO.setMessage("操作成功");
        return restfulDTO;
    }


    public static RestfulDTO success(Object data){
        RestfulDTO restfulDTO = new RestfulDTO();
        restfulDTO.setCode(200);
        restfulDTO.setMessage("操作成功");
        restfulDTO.setData(data);
        return restfulDTO;
    }


    public static RestfulDTO fail(String message){
        RestfulDTO restfulDTO = new RestfulDTO();
        restfulDTO.setCode(3450);
        restfulDTO.setMessage(message);
        return restfulDTO;
    }
}
